const Router = require('koa-router');

//控制器
const { getAll, getIndent, deleteIndent } = require('../controller/indent.controller');

//中间件
const { auth } = require('../middleware/auth.middleware');
const { validator } = require('../middleware/validator.middleware');

const router = new Router({ prefix: '/indent' });

// 查询所有订单
router.get('/getAll', auth, getAll);

//查询特定状态订单
router.get('/getIndent/:indentStatus', auth, getIndent);

//删除订单
router.delete('/delete', auth, validator({ ids: 'array' }), deleteIndent);

module.exports = router;
